package com.ngc.mall.core.enumeration;

import java.util.stream.Stream;

/**
 *
 * 优惠券时间类型
 * @author: chenxiaolin
 * @date 2023/9/13 23:20
**/
public enum CouponDateType {
    INTERVAL(1,"区间"),
    DAYS(2,"天数");
    private Integer value;
    CouponDateType(int value,String description){
        this.value=value;
    }
    public Integer getValue() {
        return value;
    }

    public static CouponDateType toType(int value){
        return Stream.of(CouponDateType.values())
                .filter(c->c.value==value)
                .findAny()
                .orElse(null);
    }
}
